#pragma once
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include<string>
class InetAddr
{
    public:
    InetAddr(sockaddr_in &sock)
    :_sockaddrin(sock)
    {
        _ip=inet_ntoa(_sockaddrin.sin_addr);
        _port=ntohs(_sockaddrin.sin_port);
    }
    ~InetAddr()
    {
    }
    std::string Ip()
    {
        return _ip;
    }
    uint16_t Port()
    {
        return _port;
    }
    private:
    sockaddr_in _sockaddrin;
    std::string _ip;
    uint16_t _port;

};